using imitateMacQQ.WebApi.Domain.Modifying_User_Information.Entity;
using imitateMacQQ.WebApi.Domain.Modifying_User_Information.Interface;
using imitateMacQQ.WebApi.Domain.Request.utils;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace imitateMacQQ.WebApi.Api;

[ApiController]
[Route("api/[controller]/[action]")]
public class UserInfoController : ControllerBase
{
    private readonly IUserInfoService _userInfoService;

    public UserInfoController(IUserInfoService userInfoService)
    {
        _userInfoService = userInfoService;
    }
    [Authorize]
    [HttpGet]
    public async Task<Request<UserInfoMap>> GetUserInfo(string account)
    {
        return await _userInfoService.GetMyselfInfo(account);
    }
    [Authorize]
    [HttpPost]
    public async Task<Request<bool>> AlterUserInfo(UserInfoMap dto)
    {
        return await _userInfoService.AlterMyselfInfo(dto);
    }
}